home *** CD-ROM | disk | FTP | other *** search
- property pStatus, pMasterList, pCurrentSession, pMainScore, pFirstScore, pSlideShowScore, pTrailerScore, pPosterScore, pLogoScore, pNotesScore, pSaveScore, pSummaryScore, pGeneralList, pSectionList, pDownLoadList, pPhotoViewList, pDSWPath, pDSWFolderExists, pFileName, pDSWFileExists, p12345, pFullPath, pTesterURL, pFlashPaperViewList, pConnectedToInternet, pFlashSprite
- global gTracker, gMaster, gNetQueue, gRecordSet, gTempList
-
- on new me
- pFlashPaperViewList = []
- pTesterURL = "http://tracking.exposurelab.com/12345.txt"
- p12345 = EMPTY
- pConnectedToInternet = "no"
- pGeneralList = [#sessionID: 0, #pkID: 0, #startDateTime: 0, #endDateTime: 0, #screenheight: 0, #screenwidth: 0, #screendepth: 0, #platform: 0]
- pSectionList = [#main: 0, #first: 0, #gallery: 0, #slideshow: 0, #trailer: 0, #poster: 0, #logos: 0, #notes: 0, #summary: 0, #flashpaper: 0, #website: 0]
- pDownLoadList = []
- pPhotoViewList = []
- pStatus = "on"
- pFileName = "stats.txt"
- if the platform contains "Mac" then
- vDisks = baDiskList()
- pDSWPath = vDisks[1] & "dswMedia"
- else
- vDisks = baDiskList()
- repeat with x = 1 to vDisks.count
- if vDisks[x] contains "c" then
- vTemp = vDisks[x]
- exit repeat
- end if
- end repeat
- pDSWPath = vTemp & "dswMedia"
- end if
- pDSWFolderExists = baFolderExists(pDSWPath)
- if pDSWFolderExists = 1 then
- vpath = pDSWPath & gMaster.pPlatformSymbol & pFileName
- pDSWFileExists = baFileExists(vpath)
- else
- pDSWFileExists = 0
- end if
- pFullPath = pDSWPath & gMaster.pPlatformSymbol & pFileName
- pFlashSprite = 200
- pGeneralList.startDateTime = the date & " " & the long time
- pGeneralList.screenheight = (the desktopRectList)[1][4]
- pGeneralList.screenwidth = (the desktopRectList)[1][3]
- pGeneralList.screendepth = (the environment).colorDepth
- pGeneralList.platform = (the environment).platform
- return me
- end
-
- on stepFrame me
- end
-
- on mAddFlashPaperView me, vWhichFlashPaper
- pFlashPaperViewList.add(vWhichFlashPaper)
- end
-
- on mCheckForPrevious me
- if p12345 = EMPTY then
- exit
- else
- if pDSWFileExists = 1 then
- else
- nothing()
- end if
- end if
- end
-
- on mWrapUpTracker me
- if p12345 = EMPTY then
- vTempList = []
- add(vTempList, pGeneralList)
- add(vTempList, pSectionList)
- add(vTempList, pDownLoadList)
- add(vTempList, pPhotoViewList)
- add(vTempList, pFlashPaperViewList)
- if pDSWFileExists = 1 then
- gTracker.mReadConvertAddReWrite(vTempList)
- else
- gTracker.mWriteString("[" & string(vTempList) & "]")
- end if
- else
- gTracker.mDeleteFileFromFolder()
- end if
- end
-
- on mNoInterNetConnection me
- if p12345 = EMPTY then
- gTracker.pGeneralList.endDateTime = the date & " " & the long time
- vTempList = []
- add(vTempList, pGeneralList)
- add(vTempList, pSectionList)
- add(vTempList, pDownLoadList)
- add(vTempList, pPhotoViewList)
- add(vTempList, pFlashPaperViewList)
- if pDSWFolderExists = 1 then
- if pDSWFileExists = 1 then
- gTracker.mReadConvertAddReWrite(vTempList)
- else
- gTracker.mWriteString("[" & string(vTempList) & "]")
- end if
- else
- baCreateFolder(gTracker.pDSWPath)
- gTracker.mWriteString("[" & string(vTempList) & "]")
- end if
- end if
- end
-
- on mCheckInternetConnection me
- gNetQueue.mGetNetText(pTesterURL, #mFileTheResults, gNetQueue)
- gNetQueue.pStartTimer = the timer
- gNetQueue.pStepframe = "waiting"
- end
-
- on mReadConvertAddReWrite me, vList
- vString = gTracker.mReadFile()
- gTempList = []
- gTempList = value(vString)
- vCount = gTempList.count
- add(gTempList, vList)
- put string(gTempList)
- gTracker.mDeleteFileFromFolder()
- gTracker.mWriteString(string(gTempList))
- end
-
- on mStartTracker me
- end
-
- on mDeleteFileFromFolder me
- Ok = baDeleteFile(pFullPath)
- pDSWFileExists = 0
- end
-
- on mReadFile me
- myFile = new(xtra("fileIO"))
- fileName = gTracker.pFullPath
- if fileName <> EMPTY then
- myFile.openfile(fileName, 1)
- vTempString = myFile.readFile()
- end if
- vTempList = []
- vTempList = value(vTempString)
- put "vTempList count: " & vTempList.count
- myFile.closeFile()
- if offset("&", vTempString) > 0 then
- vTempString = "[" & vTempString & "]"
- mainText = vTempString
- else
- mainText = vTempString
- end if
- myFile = 0
- return mainText
- end
-
- on mReadStoredData me
- myFile = new(xtra("fileIO"))
- fileName = gTracker.pFullPath
- if fileName <> EMPTY then
- myFile.openfile(fileName, 1)
- vTempString = myFile.readFile()
- end if
- vTempList = []
- vTempList = value(vTempString)
- gRecordSet.pMasterList = vTempList
- myFile.closeFile()
- myFile = 0
- gRecordSet.mProcessStoredRecordSet()
- end
-
- on mReplaceText me, mainText, SearchString, replaceString
- theReplaceLen = SearchString.length - 1
- charStart = offset(SearchString, mainText)
- repeat while charStart <> 0
- if charStart <> 0 then
- put replaceString into mainText.char[charStart..charStart + theReplaceLen]
- charStart = offset(SearchString, mainText)
- next repeat
- end if
- put SearchString && "not found in text"
- end repeat
- return mainText
- end
-
- on mAddPhotoView me, vWhichPhoto
- pPhotoViewList.add(vWhichPhoto)
- end
-
- on mAddDownLoad me, vType, vName
- if (vType = "doc") or (vType = "pdf") then
- case gMaster.pLanguageMode of
- "english":
- vType = "E" & vType
- "spanish":
- vType = "S" & vType
- end case
- end if
- vList = [vType, vName]
- pDownLoadList.add(vList)
- end
-
- on mPutListsToString me
- global gTempList
- vText = "[" & string(pGeneralList) & ", " & string(pSectionList) & ", " & string(pDownLoadList) & ", " & string(pPhotoViewList) & "]"
- gTempList = []
- gTempList = value(vText)
- put gTempList & RETURN & RETURN
- put gTempList[1] & RETURN & RETURN
- put gTempList[2] & RETURN & RETURN
- put gTempList[3] & RETURN & RETURN
- put gTempList[4] & RETURN & RETURN
- end
-
- on mAddSection me, vWhichSection
- case vWhichSection of
- "main":
- vCount = pSectionList.main
- pSectionList.main = vCount + 1
- "first":
- vCount = pSectionList.first
- pSectionList.first = vCount + 1
- "1g", "2g", "3g", "4g", "5g", "6g", "7g", "8g", "9g", "10g":
- vCount = pSectionList.gallery
- pSectionList.gallery = vCount + 1
- "slideshow":
- vCount = pSectionList.slideshow
- pSectionList.slideshow = vCount + 1
- "trailer":
- vCount = pSectionList.trailer
- pSectionList.trailer = vCount + 1
- "poster":
- vCount = pSectionList.poster
- pSectionList.poster = vCount + 1
- "logos":
- vCount = pSectionList.logos
- pSectionList.logos = vCount + 1
- "FP1", "FP1s", "FP2", "FP2s", "FP3", "FP3s":
- vCount = pSectionList.notes
- pSectionList.notes = vCount + 1
- "notes":
- vCount = pSectionList.notes
- pSectionList.notes = vCount + 1
- "save1", "save2", "save3":
- vCount = pSectionList.summary
- pSectionList.summary = vCount + 1
- "website":
- vCount = pSectionList.website
- pSectionList.website = vCount + 1
- end case
- end
-
- on mWriteString me, vString
- vFileIOObj = 0
- vFileIOObj = new(xtra("fileIO"))
- if the platform contains "mac" then
- setFilterMask(vFileIOObj, "TEXT")
- else
- setFilterMask(vFileIOObj, "Text Files,*.txt,All Files,*.*")
- end if
- createFile(vFileIOObj, pFullPath)
- openfile(vFileIOObj, pFullPath, 0)
- yyy = writeString(vFileIOObj, vString)
- closeFile(vFileIOObj)
- vFileIOObj = 0
- end
-
- on mAppendString me, vString
- vString2 = "&" & vString
- vFileIOObj = new(xtra("fileIO"))
- if the platform contains "mac" then
- setFilterMask(vFileIOObj, "TEXT")
- else
- setFilterMask(vFileIOObj, "Text Files,*.txt,All Files,*.*")
- end if
- openfile(vFileIOObj, pFullPath, 0)
- setPosition(vFileIOObj, getLength(vFileIOObj))
- writeString(vFileIOObj, vString2)
- closeFile(vFileIOObj)
- vFileIOObj = 0
- end
-
- on mWriteDataOLD me
- global gMasterFolder
- fileObj2 = new(xtra("fileIO"))
- vpath = the moviePath
- vTemp = vpath & "Captions.txt"
- vTemp2 = vpath & "Captions.txt"
- if the platform contains "Mac" then
- vDisks = baDiskList()
- else
- vDisks = baDiskList()
- end if
- vDisks = baDiskList()
- pSystemFolderPath = baSysFolder("system")
- pDSWMediaPath = pSystemFolderPath & "dswmedia"
- vOK = 0
- if baFileExists(vTemp) = 1 then
- vOK = 1
- else
- vOK = 0
- end if
- if vOK = 1 then
- vMasterPath = gMasterFolder
- else
- if baFileExists(vTemp2) = 1 then
- vOK = 2
- vMasterPath = gMasterFolder
- else
- vOK = 0
- vMasterPath = gMasterFolder
- end if
- end if
- case vOK of
- 0:
- saveText2(vTemp2, gMaster.pCaption1, gMaster.pCaption2, gMaster.pCaption3)
- 1, 2:
- openfile(fileObj2, vTemp2, 0)
- if status(fileObj2) <> 0 then
- err = error(fileObj2, status(fileObj2))
- alert("Error:" && err)
- return EMPTY
- end if
- vText = readFile(fileObj2)
- closeFile(fileObj2)
- saveText1(vText, vTemp2, gMaster.pCaption3)
- end case
- end
-
- on mAddActor me
- add(the actorList, me)
- end
-
- on mDeleteActor me
- where = getOne(the actorList, me)
- if where > 0 then
- deleteAt(the actorList, where)
- end if
- end
-
- on mSerializeRecordSet me
- vFlashSprite = 200
- vFieldsList = ["aaa", "bbb", "ccc"]
- vFieldCount = vFieldsList.count
- vRecordsList = [["111", "222", "333"], ["444", "555", "666"], ["777", "888", "999"]]
- vRecordCount = vRecordsList.count
- vFields = sprite(vFlashSprite).newObject("Array")
- repeat with i = 1 to vFieldCount
- vFields.push(vFieldsList[i])
- end repeat
- vRecordSet = newObject("RecordSet")
- repeat with i = 1 to vRecordCount
- vRecord = sprite(vFlashSprite).newObject("Object")
- vCount = 0
- repeat with j = 0 to vFieldCount - 1
- vCount = vCount + 1
- vFieldItem = vFieldsList[vCount]
- vRecord.setProp(symbol(vFieldItem), vRecordsList[i][vCount])
- end repeat
- vRecordSet.addItem(vRecord)
- end repeat
- return vRecordSet
- end
-